'use strict';
exports.main = async (event, context) => {
  const db = uniCloud.database();
  
  // 简单查询所有商户
  try {
    const result = await db.collection('tenants').limit(100).get();
    console.log('查询到的商户数据:', result.data);
    
    return {
      code: 0,
      message: '查询成功',
      data: result.data
    };
  } catch (e) {
    console.error('查询出错:', e);
    return {
      code: 500,
      message: '查询失败: ' + e.message
    };
  }
}; 